import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    user: null,
    token: window.localStorage.getItem('satoken') || ''
  },
  mutations: {
    setUser (state, user) {
      state.user = user
    },
    setToken (state, token) {
      window.localStorage.setItem('satoken', token)
    }
  },
  actions: {},
  modules: {}
})
